#pragma once

#include <QDialog>
#include <qglobal.h>

QT_BEGIN_NAMESPACE
class CPluginDlgPrivate;
class QTreeWidgetItem;
QT_END_NAMESPACE

class CPluginDlg : public QDialog
{
	Q_OBJECT

public:
	CPluginDlg(QWidget *parent = nullptr);
	CPluginDlg(QStringView plug_path, const QStringList& filenames, QWidget* parent = nullptr);
	~CPluginDlg();
protected:
	void OnInitDialog();
private:
	void FindPlguins(QStringView plug_path, const QStringList& filenames);
	void PopulateTreeWidget(QObject* plugin, QStringView text);
	void AddItems(QTreeWidgetItem* plug_item, const char* interface_name, const QStringList& features);
private:
	CPluginDlgPrivate* const d_ptr;
	Q_DECLARE_PRIVATE(CPluginDlg)
};
